package com.ssh;

import org.junit.Test;

public class RemoveElement_27 {
	public int removeElement(int[] nums, int val) {
		int i = 0;
        for (int n : nums) {
        	if (n != val) {
        		nums[i++] = n;
        	}
        }
        for (int n : nums) {
        	System.out.print(n+"\t");
        }
        return i;
    }
	@Test
	public void test () {
		int[] nums = {3,2,2,3};
		System.out.println(removeElement(nums, 3));
	}
}
